How to purge a unwanted folder using dxl? Any help?
|
Re: deletion of a folder string purge(Item) string purge(Folder) so turn the name of the folder into either an Item of Folder handle: purge(item(NameFolder)) purge(folder(NameFolder)) Nothing can be open in the folder, so you cannot purge the current folder since YOU have it open. I recall that Objects would not purge unless they were first UNdeleted, perhaps that applies to folders. Folder fld = folder(NameFolderToDelete) if (isDeleted(fld)) undelete(fld) // ?? May not be needed?? string ErrMess = purge(fld) The hard part of such a program is specifying with absolute confidence which folders are "unwanted". Its probably easier to do such purging manually, and hopefully mindfully. I'd be tempted to first convert the folder to a project, archive it, then purge the temp project.
|
Re: deletion of a folder |
Re: deletion of a folder llandale - Sat Oct 29 15:14:30 EDT 2011
Hello,
Item fol = item "/CNPE - Project/sample"
delete (fol)
string ErrMess = purge(fol)
if(!null ErrMess){errorBox(ErrMess)}
|
Re: deletion of a folder SystemAdmin - Thu Aug 30 10:54:06 EDT 2012
Hello,
Item fol = item "/CNPE - Project/sample"
delete (fol)
string ErrMess = purge(fol)
if(!null ErrMess){errorBox(ErrMess)}
Changing the current folder is not enough to 'close' the folder. You need to set the DOORS database Explorer to a new directory (best "/") before you delete the folder. Maybe this helps, regards, Mathias
string wipeFolder (string s) {
openPath "/" // go to the root folder in the database
// you might want to do something more elaborate her
current = folder "/"
Folder f = folder s
if (!null f) {
noError()
if (!isDeleted f) delete f
string errMsg1 = purge f
string errMsg2 = lastError()
return errMsg1 errMsg2
}
return ""
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: deletion of a folder Mathias Mamsch - Thu Aug 30 11:15:47 EDT 2012
Changing the current folder is not enough to 'close' the folder. You need to set the DOORS database Explorer to a new directory (best "/") before you delete the folder. Maybe this helps, regards, Mathias
string wipeFolder (string s) {
openPath "/" // go to the root folder in the database
// you might want to do something more elaborate her
current = folder "/"
Folder f = folder s
if (!null f) {
noError()
if (!isDeleted f) delete f
string errMsg1 = purge f
string errMsg2 = lastError()
return errMsg1 errMsg2
}
return ""
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Hello, -E- DXL: <E:\DOORS BK Script\rename_root2.dxl:4> incorrectly concatenated tokens -E- DXL: <E:\DOORS BK Script\rename_root2.dxl:4> undeclared variable (openPath) -I- DXL: All done. Errors reported: 2. Warnings reported: 0. Press return to exit DOORS. |
Re: deletion of a folder SystemAdmin - Thu Aug 30 12:20:32 EDT 2012
Hello, -E- DXL: <E:\DOORS BK Script\rename_root2.dxl:4> incorrectly concatenated tokens -E- DXL: <E:\DOORS BK Script\rename_root2.dxl:4> undeclared variable (openPath) -I- DXL: All done. Errors reported: 2. Warnings reported: 0. Press return to exit DOORS. Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: deletion of a folder SystemAdmin - Thu Aug 30 10:54:06 EDT 2012
Hello,
Item fol = item "/CNPE - Project/sample"
delete (fol)
string ErrMess = purge(fol)
if(!null ErrMess){errorBox(ErrMess)}
Yes, I'm sure you will need to be sure you are not "in" the target folder; for me that is:
-Louie |